|
|
rand() is random enough for most pusposes.
If you're not getting an equal distribution from it, then you're probably
using it wrong.
*looks at source code*
translate <rand(trans)+15,rand(trans)+10,-rand(trans)+15>
rotate <rand(rot)*360,rand(rot)-21,rand(rot)*360>
Try rotating before translating.
What you're doing now, is translating it into a random position in the box
from <15,10,14> to <16,11,15>. Then you're rotating it (*around the origin*)
to a new position. This causes them to fill the area created by a sphere of
radius sqrt(16^2+11^2+15^2) differenced with a sphere of radius
sqrt(15^2+10^2+14^2), and causes their orientation to be relative to their
position to the origin.
So first rotate, then translate, like this:
rotate <rand(rot),rand(rot),rand(rot)>*360 // orient randomly
translate <rand(trans)+15,rand(trans)+10,-rand(trans)+15> // translate into
a random position in the box
rotate -21*y // because you seem to want to rotate -21*y from your original
code
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|